package com.mx.controller;

import com.mx.mapper.ArticleMapper;
import com.mx.mapper.ArticleTagMapper;
import com.mx.mapper.CommentMapper;
import com.mx.mapper.TagMapper;
import com.mx.pojo.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class IndexController {
    @Autowired
    ArticleMapper articleMapper;
    @Autowired
    ArticleTagMapper articleTagMapper;
    @Autowired
    CommentMapper commentMapper;
    @Autowired
    TagMapper tagMapper;

    @RequestMapping("/getArticles")
    public List<Article> getArticles(){
        List<Article> articles = articleMapper.selectList(null);
        return articles;
    }




















}
